
using AutoMapper;
using Data.Models;
using Domain.Commands;
using QuanLySanXuat.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace QuanLySanXuat.Mappers
{
    public class ViewModelToDomainMappingProfile : Profile
    {
        public override string ProfileName
        {
            get { return "ViewModelToDomainMappings"; }
        }

        protected override void Configure()
        {
            Mapper.CreateMap<ProductTypeFormModels, CreateOrUpdateProductTypeCommand>();
            Mapper.CreateMap<CategoryFormModels, CreateOrUpdateCategoryCommand>();
            Mapper.CreateMap<ContactFormModels, CreateOrUpdateContactCommand>();
            Mapper.CreateMap<CompanyFormModels, CreateOrUpdateCompanyCommand>();
            Mapper.CreateMap<ActualGoodInStockFormModels, CreateOrUpdateActualGoodInStockCommand>();
            Mapper.CreateMap<CurrencyFormModels, CreateOrUpdateCurrencyCommand>();
            Mapper.CreateMap<ProductFormModels, CreateOrUpdateProductCommand>();
            Mapper.CreateMap<PurchaseDetailFormModels, CreateOrUpdatePurchaseDetailCommand>();
            Mapper.CreateMap<PurchaseFormModels, CreateOrUpdatePurchaseCommand>();
            Mapper.CreateMap<StockFormModels, CreateOrUpdateStockCommand>();
            Mapper.CreateMap<UOMFormModels, CreateOrUpdateUOMCommand>();
            Mapper.CreateMap<UserFormModels, CreateOrUpdateUserCommand>();
            Mapper.CreateMap<MachineFormModels, CreateOrUpdateMachineCommand>();
            Mapper.CreateMap<MaterialFormModels, CreateOrUpdateMaterialCommand>();
            Mapper.CreateMap<MaterialTypeFormModels, CreateOrUpdateMaterialTypeCommand>();
            Mapper.CreateMap<BOMDetailFormModels, CreateOrUpdateBOMDetailCommand>();
            Mapper.CreateMap<BOMFormModels, CreateOrUpdateBOMCommand>();
            Mapper.CreateMap<AccessoryFormModels, CreateOrUpdateAccessoryCommand>();
            Mapper.CreateMap<BOMAccessorie_DetailsFormModels, CreateOrUpdateBOMAccessorie_DetailsCommand>();
            Mapper.CreateMap<WorkerLevelFormModels, CreateOrUpdateWorkerLevelCommand>();
            Mapper.CreateMap<BOMWorker_DetailsFormModels, CreateOrUpdateBOMWorker_DetailsCommand>();
            Mapper.CreateMap<BOMMachine_DetailsFormModels, CreateOrUpdateBOMMachine_DetailsCommand>();

            //Dung cho kho ProductModel
            Mapper.CreateMap<ToolFormulaFormModels,CreateOrUpdateToolFormulaCommand>();
            Mapper.CreateMap<ToolTypeFormModels, CreateOrUpdateToolTypeCommand>();
            Mapper.CreateMap<OtherCostFormModels, CreateOrUpdateOtherCostCommand>();
            Mapper.CreateMap<OtherCostFormulaFormModels, CreateOrUpdateOtherCostFormulaCommand>();
            Mapper.CreateMap<DesginDetailFormModels, CreateOrUpdateDesignDetailCommand>();
            Mapper.CreateMap<MaterialFormulaFormModels, CreateOrUpdateMaterialFormulaCommand>();
            Mapper.CreateMap<LabourFormulaFormModels, CreateOrUpdateLabourFormulaCommand>();
            Mapper.CreateMap<ProductModelFormModels, CreateOrUpdateProductModelCommand>();
            //
            Mapper.CreateMap<LevelNormFormModels, CreateOrUpdateLevelNormCommand>();
            Mapper.CreateMap<ToolNormFormModels, CreateOrUpdateToolNormCommand>();
            //Dung cho du lieu tham chieu
            Mapper.CreateMap<UnitFormModels, CreateOrUpdateUnitCommand>();
            Mapper.CreateMap<EmployeeFormModels, CreateOrUpdateEmployeeCommand>();
            Mapper.CreateMap<WorkplaceFormModels, CreateOrUpdateWorkplaceCommand>();

            //Dung cho lenh san xuat
            Mapper.CreateMap<OrderFormModels, CreateOrUpdateOrderCommand>();
            Mapper.CreateMap<MaterialDetailFormModels, CreateOrUpdateMaterialDetailCommand>();
            Mapper.CreateMap<OtherCostDetailFormModels, CreateOrUpdateOtherCostDetailCommand>();
            Mapper.CreateMap<ToolDetailFormModels, CreateOrUpdateToolDetailCommand>();
            Mapper.CreateMap<LabourDetailFormModels, CreateOrUpdateLabourDetailCommand>();

            //Dung cho thuc hien lenh san xuat
            Mapper.CreateMap<OrderProcessFormModels, CreateOrUpdateOrderProcessCommand>();
            Mapper.CreateMap<CostDetailFormModels, CreateOrUpdateCostDetailCommand>();
            Mapper.CreateMap<SubprocessDetailFormModels, CreateOrUpdateSubprocessDetailCommand>();

            //Dung cho ket thuc san xuat
            Mapper.CreateMap<OrderSummaryFormModels, CreateOrUpdateOrderSummaryCommand>();
            Mapper.CreateMap<StorageDetailFormModels, CreateOrUpdateStorageDetailCommand>();

            //Dung cho phieu xuat
            Mapper.CreateMap<BillOutFormModels, CreateOrUpdateBillOutCommand>();
            Mapper.CreateMap<BillDetailFormModels, CreateOrUpdateBillDetailCommand>();


        }
    }
}

